package cn.cloudplug.core.util.log;

import android.util.Log;

/**
 * Created by pc on 2018/1/25.
 */

public class LogUtil {

    private static final int VERBOSE = 1;
    private static final int DEBUG = 2;
    private static final int INFO = 3;
    private static final int WARN = 4;
    private static final int ERROR = 5;
    private static final int NOTHING = 6;

    //控制log等级
    private static int LEVEL = VERBOSE;

    public static void v(String tag, String message) {
        if (LEVEL <= VERBOSE) {
            Log.v(tag, message);
        }
    }

    public static void d(String tag, Object message) {
        if (LEVEL <= DEBUG) {
            Log.d(tag,message.toString());
        }
    }

    public static void d(Object message) {
        if (LEVEL <= DEBUG) {
            Log.d(message.getClass().getName(),message.toString());
        }
    }

    public static void i(String tag, String message) {
        if (LEVEL <= INFO) {
            Log.i(tag,message);
        }
    }

    public static void w(String tag, String message) {
        if (LEVEL <= WARN) {
            Log.w(tag,message);
        }
    }

    public static void e(String tag, String message) {
        if (LEVEL <= ERROR) {
            Log.e(tag,message);
        }
    }
}

